const host = process.env.NODE_ENV === 'production'
? 'http://192.168.1.112:8080/'
: 'http://192.168.1.112:8080/'

export const commonApi = {
  // GET
  oAuthUrl: type => host + '/oauth/' + type,
  // GET
  captchaUrl: () => host + '/captcha',
  // POST
  checkCaptchaUrl: captcha => host + '/captcha?captcha=' + captcha,
  // POST
  checkUsernameUrl: username => host + '/inspection/username?name=' + username,
  // POST
  checkUserEmailUrl: userEmail => host + '/inspection/userEmail?email=' + userEmail,
  // POST
  checkVerificationUrl: verification => host + '/inspection/verification?verification=' + verification,
  // POST
  sendEmailUrl: email => host + '/email?email=' + email
}

export const userApi = {
  // POST
  loginUrl: () => host + '/authentication/token',
  // POST
  registerUrl: () => host + '/authentication/account',
  // GET
  getProfileUrl: () => host + '/accounts/profile',
  // POST
  updateProfileUrl: () => host + '/accounts/profile',
  // POST
  updatePasswordUrl: () => host + '/accounts/password',
  // POST
  resetPasswordUrl: () => host + '/accounts/reset-password',
  // POST
  sendMessageUrl: () => host + '/send'
}

export const chartApi = {
  serverRoot: () => "WaterInformationCloud/api/",
  // GET
  phoneSMSRecordUrl: () => host + chartApi.serverRoot() + 'getPhoneSMSRecord'
}
